﻿using System;
using System.Diagnostics;
using System.Linq;

namespace Microsoft.Coding4Fun.TweetCraft.Tray
{
    internal static class ProcessExtensions
    {
        public static bool IsAlreadyRunning(this Process process)
        {
            if (process == null)
                throw new ArgumentNullException("process");

            return Process.GetProcessesByName(process.ProcessName).Count() > 1;
        }
    }
}
